/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package inet.controller;

import inet.dao.BranchDAO;
import inet.entity.Branch;
import java.util.ArrayList;
import java.util.List;
import javax.faces.bean.ManagedBean;
//import javax.faces.bean.RequestScoped;
import javax.faces.bean.SessionScoped;
import javax.faces.bean.SessionScoped;

/**
 *
 * @author ÂuNgọcThái
 */
@ManagedBean
@SessionScoped
public class BranchController {

    /**
     * Creates a new instance of BranchController
     */
    Branch branch =null;
    BranchDAO branchDAO= null;
    List<Branch> lstbranch =null;
    public BranchController() {
        branch =new Branch();
        branchDAO= new BranchDAO();
        lstbranch =new ArrayList();
    }

    public Branch getBranch() {
        return branch;
    }

    public void setBranch(Branch branch) {
        this.branch = branch;
    }

    public BranchDAO getBranchDAO() {
        return branchDAO;
    }

    public void setBranchDAO(BranchDAO branchDAO) {
        this.branchDAO = branchDAO;
    }

    public List<Branch> getLstbranch() {
        return lstbranch;
    }

    public void setLstbranch(List<Branch> lstbranch) {
        this.lstbranch = lstbranch;
    }
    
    public List<Branch> getListBranch(){
        branchDAO =new BranchDAO();
        lstbranch = branchDAO.getAll();
        return lstbranch;
    }
}
